package _jwt;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

import java.io.IOException;
import java.nio.charset.Charset;

public class Base64Test {

    public static void main(String[] args) throws IOException {
        BASE64Encoder base64Encoder = new BASE64Encoder();
        String encode = base64Encoder.encode("hy000".getBytes(Charset.forName("utf-8")));

        //aHkwMDA=
        System.out.println(encode);

        BASE64Decoder base64Decoder = new BASE64Decoder();
        byte[] bytes = base64Decoder.decodeBuffer(encode);
        System.out.println(new String(bytes));
    }
}
